# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fractal
pkgver=4.4.2
pkgrel=2
pkgdesc="Matrix group messaging app"
url="https://wiki.gnome.org/Apps/Fractal"
arch="x86_64 x86 armhf armv7 aarch64 ppc64le" # limited by Rust
license="GPL-3.0-or-later"
depends="
	dbus:org.freedesktop.Secrets
	gst-plugins-good-gtk
	xdg-utils
	"
makedepends="
	cargo
	dbus-dev
	glib-dev
	gmp-dev
	gspell-dev
	gst-editing-services-dev
	gst-plugins-bad-dev
	gst-plugins-base-dev
	gstreamer-dev
	gtk+3.0-dev
	gtksourceview4-dev
	libhandy-dev
	meson
	openssl-dev
	"
options="!check" # no tests
subpackages="$pkgname-lang"
source="$pkgname-$pkgver.tar.gz::https://gitlab.gnome.org/GNOME/fractal/-/archive/$pkgver/fractal-$pkgver.tar.gz
	cargo-home.patch
	libc.patch
	"

case "$CARCH" in
	x86)
		export CFLAGS="$CFLAGS -fno-stack-protector"
		;;
esac


build() {
	abuild-meson . output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
a1574af97596f0edba8356f73eb1dbfbf6d871032a7cba95e4d72d3c7f0a725bbf82ef99e59848d9a7a2c80966c0dcb3a910e0faa431d164c37be6a081176098  fractal-4.4.2.tar.gz
41f2c2f04a459da5a9d79fbf05e5fdc37f6fd199136fd2e691b384bb51c91819b5df4432ee4c9378be9e6fcf74e91fb4fcaef56d7fd663da19b33192f6e012b8  cargo-home.patch
d8a7100873f971bbf6a7a67cc32ad651b2b6a7ecf35cdc1d1743f7111af065a7e70cee3a936b5954c0c76e5b2cd6ebaf4f1e0f7526e74c22c73f8ea535b74721  libc.patch
"
